package org.hope.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class HelloService {

    @Autowired
    RestTemplate restTemplate;

    public String hiService(String name) {
        //这里不能用这个localhost，否则调用不成功
//        return restTemplate.getForEntity("http://localhost:8877/hello?name=" + name, String.class).getBody();
        return restTemplate.getForEntity("http://service-ha-hello/hello?name=" + name, String.class).getBody();
    }

}
